package com.xin.di.uav.applet.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xin.di.uav.applet.resp.BillingResponse;
import com.xin.di.uav.applet.resp.CarrierWaybillResponse;
import com.xin.di.uav.applet.resp.OrderResponse;
import com.xin.di.uav.common.request.operate.OrderInfoReq;
import com.xin.di.uav.common.request.order.*;
import com.xin.di.uav.common.response.order.task.DistributionOrderListRes;
import com.xin.di.uav.common.utils.RespJsonPageData;
import com.xin.di.uav.user.order.po.OrderPO;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author LTQ
 * @since 2023-05-08
 */
public interface IOrderInfoService extends IService<OrderPO> {

    /**
     * 添加
     *
     * @param orderInfoAddRequest
     */
    void add(OrderInfoAddRequest orderInfoAddRequest);

    /**
     * 获取订单
     *
     * @param page
     * @param size
     * @return
     */
    List<OrderPO> getOrders(@RequestParam Integer page, @RequestParam Integer size);






    /**
     * 获取总用户数
     *
     * @param platformCode
     * @param tcWaybillNo
     * @param tradeNo
     * @param type
     * @return
     */
    Long getTotal(@RequestParam(required = false) String tcWaybillNo, @RequestParam(required = false) String tradeNo, @RequestParam(required = false) Integer type, @RequestParam(required = false) Integer platformCode, @RequestParam(required = false) String enterpriseId, @RequestParam(required = false) Integer payStatus, Date startTransactionTime, Date endTransactionTime);

    /**
     * 插入
     *
     * @param entity
     * @return
     */
    int insert(OrderPO entity);

    /**
     * 查询列表
     *
     * @param queryWrapper
     * @return
     */
    List<OrderPO> selectList(@Param(Constants.WRAPPER) Wrapper<OrderPO> queryWrapper);

    /**
     * 分页查询
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<OrderPO> selectPage(Page page, @Param(Constants.WRAPPER) Wrapper<OrderPO> queryWrapper);

    /**
     * 查询一条
     *
     * @param queryWrapper
     * @return
     */
    OrderPO selectOne(@Param(Constants.WRAPPER) Wrapper<OrderPO> queryWrapper);



    /**
     * 更新任务状态
     *
     * @param updateStatusRequest
     */
    void updateStatus(UpdateStatusRequest updateStatusRequest);



    /**
     * 更新任务状态
     *
     * @param flightRequest
     */
    void updateStatusBySn(FlightRequest flightRequest);


    /**
     * 更新任务状态
     *
     * @param takOffRequest
     */
    void takeOffNotify(TakOffRequest takOffRequest);


    /**
     * 更新任务状态
     *
     * @param landingRequest
     */
    void landingNotify(LandingRequest landingRequest);


    void pickUpCodeNotify(PickUpCodeRequest pickUpCodeRequest);





}
